#region README

/*
 * README
 * 
 * Current Thread User : GUOCOLAND\wangyucai
 * Machine Name : GLCHQWYCWINW7
 * Visual Studio : Microsoft Visual Studio 2010 Ultimate Edition
 * Create Time : 2015-02-10 14:39:31
 * Common Language Runtime : 4.0.30319.18444
 * Minimum .Net Framework Version : 4.0
 * 
 * SourcePro Studio 2015
 * Project Url : https://github.com/SourceproStudio/CodeTemplates
 * Home Page Url : https://github.com/SourceproStudio
 * E-mail Address : MasterDuner@yeah.net or Yucai.Wang-Public@outlook.com
 * QQ : 180261899
 */

#endregion

using System;
using System.Windows;

namespace Dearcodes.Examples.Wpf.Attached
{
    /// <summary>
    /// <para>
    /// Description
    /// </para>
    /// <para>
    /// Namespace : <see cref="Dearcodes.Examples.Wpf.Attached"/>
    /// </para>
    /// <para>
    /// Type : <see cref="AttachedProperty"/>
    /// </para>
    /// <para>
    /// The minimum .Net Framework version requirements : 4.0
    /// </para>
    /// <para>
    /// Can not inherit from <see cref="AttachedProperty"/> !
    /// </para>
    /// </summary>
    /// <seealso cref="Dearcodes.Examples.Wpf.Attached"/>
    /// <remarks>
    /// Can not inherit from <see cref="AttachedProperty"/> !
    /// </remarks>
    public sealed class AttachedProperty : DependencyObject
    {
        #region AttachedProperty Constructors

        /// <summary>
        /// <para>
        /// 用于初始化一个<see cref="AttachedProperty" />对象实例。
        /// </para>
        /// </summary>
        public AttachedProperty()
        { }

        #endregion

        public static void AttachedChangedCallback(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            MessageBox.Show(sender.GetType().FullName);
        }

        public static int GetExpando(DependencyObject obj)
        {
            return (int)obj.GetValue(ExpandoProperty);
        }

        public static void SetExpando(DependencyObject obj, int value)
        {
            obj.SetValue(ExpandoProperty, value);
        }

        // Using a DependencyProperty as the backing store for Expando.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ExpandoProperty =
            DependencyProperty.RegisterAttached("Expando", typeof(int), typeof(AttachedProperty), new UIPropertyMetadata(0, new PropertyChangedCallback(AttachedChangedCallback)));


    }
}

/*
 * Copyright © 2015 Wang Yucai. All rights reserved.
 */